﻿Imports System.Data.SqlClient

Public Class CnGeorgiaHeader
    Inherits System.Web.UI.UserControl
    Private objrd As SqlDataReader = Nothing
    Private objfind As New GetData
    Private sSQL As String
    Private ps As New PreparedStatement(sSQL)
    Private userId As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Session("uid") <> Nothing And Session("uid") <> "") Then
            Dim sSQL As String
            Dim strErr As String = ""
            sSQL = "select * from member_info where member_id = @userId and lang_flag = 'zh'"
            ps.addParameter("userId", Session("uid"))
            ps.strSql = sSQL
            Dim conn As SqlConnection = objfind.getConn()

            objrd = objfind.dr(ps, strErr, conn, objrd)
            If (objrd.Read()) Then
                memberlogin.InnerText = objrd.Item("member_name") & "，会员中心"
            Else
                memberlogin.InnerText = "会员中心"
            End If
            objfind.closeConn(conn)

            memberlogin.HRef = "/chinese/members/members-home.aspx"

            memberlogout.InnerHtml = " | <a href=""/chinese/members/members-logout.aspx"">退出登录</a>"
        End If
    End Sub

End Class